#pragma once
#include "wfx.h"
#include <hash_map>
#include <string>


/*
 *	CSymbolTable
 *	a super simple implementation of symbol table
 */

MAKE_PTR(CSymbolTable);

class CSymbolTable
{
public:

	static CSymbolTablePtr create()
	{
		return CSymbolTablePtr(new CSymbolTable());
	}

	~CSymbolTable();

protected:

	CSymbolTable();

	stdext::hash_map<std::string, int> m_symbol;

public:

	void registerSymbol(const std::string& strName, int num);

	int getSymbol(const std::string& strName);

	bool lookup(const std::string& strName);
};